package com.example.finalwork2.handler;

import com.example.finalwork2.entity.VehicleSignal;
import org.springframework.stereotype.Component;

@Component
public class OutputHandler extends AbstractSignalHandler {
    @Override
    public void handle(VehicleSignal data) {
        if (data.isCategory()) {
            System.out.println("输出：需要预警，预警信息如下：");
            data.getWarnings().forEach(System.out::println);
        } else {
            System.out.println("输出：不需要预警");
        }
    }
}
